import i18n from "@/i18n";
import reg from "@/common/reg";



export default {
    required: [
        // Please_enter
        {required: true, message: i18n.t('m.This_field_required'), trigger: 'blur'}
    ],
    requiredChoose: [
        {required: true, message: i18n.t('m.pleaseChoose'), trigger: ['blur', 'change']},
    ],
    phone: [
        {required: true, message: i18n.t('m.Enterphonenumber'), trigger: 'blur'},
        {pattern: reg.mobile, message: i18n.t('m.Shop_Created_shop_phone'), trigger: 'blur'}
    ],
    // 验证码
    msgCode: [
        {required: true, message: i18n.t('m.PleaseEnterTheVerificationCode'), trigger: 'blur'},
        {pattern: reg.validCode, message: i18n.t('m.EnterCorrectVerificationCode'), trigger: 'blur'}
    ],
    password: [
        {required: true, message: i18n.t('m.Enterpassword'), trigger: 'blur'},
        {pattern: reg.password, message: i18n.t('m.Set_login_password'), trigger: 'blur'}
    ],
    email: [
        {required: true, message: i18n.t('m.Please_enter_Email'), trigger: 'blur'},
        {pattern: reg.email, message: i18n.t('m.EnterCorrectEmail'), trigger: 'blur'}
    ],
    url: [
        {
            pattern: /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/,
            message: i18n.t('m.cannotBlank'),
            trigger: 'blur'
        }
    ]
}

